package com.innovation.chengzhangriji.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.innovation.chengzhangriji.R;
import com.innovation.chengzhangriji.ui.widget.CuteToolbar;

public class TimelineEmptyFragment extends BaseFragment implements CuteToolbar.OnClickCuteToolbarListener {

    private boolean show;

    private ImageView mPoint;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_timeline_empty, container, false);
        CuteToolbar cuteToolbar = (CuteToolbar) view.findViewById(R.id.toolbar);
        cuteToolbar.setOnClickCuteToolbarListener(this);
        mPoint = (ImageView) view.findViewById(R.id.image_point);
        if (show) {
            mPoint.setVisibility(View.VISIBLE);
        } else {
            mPoint.setVisibility(View.INVISIBLE);
        }
        return view;
    }

    @Override
    public void onClickLeft() {
        if (getActivity() instanceof TimelineActivity) {
            ((TimelineActivity) getActivity()).openDrawer();
        }
    }

    @Override
    public void onClickRight() {

    }

    public void setVisibilityPoint(boolean show) {
        this.show = show;
        if (mPoint == null) {
            return;
        }
        if (show) {
            mPoint.setVisibility(View.VISIBLE);
        } else {
            mPoint.setVisibility(View.INVISIBLE);
        }
    }
}
